﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;


namespace FirstGame
{
    public class SettingScreen : MenuScreen
    {
        private VolumeControl _Volumecontrol;

        public VolumeControl Volumecontrol
        {
            get { return _Volumecontrol; }
            set { _Volumecontrol = value; }
        }
        private CheckItem _HardLevel;

        public CheckItem HardLevel
        {
            get { return _HardLevel; }
            set { _HardLevel = value; }
        }
        private CheckItem _NormalLevel;

        public CheckItem NormalLevel
        {
            get { return _NormalLevel; }
            set { _NormalLevel = value; }
        }
        private CheckItem _EasyLevel;

        public CheckItem EasyLevel
        {
            get { return _EasyLevel; }
            set { _EasyLevel = value; }
        }

        public SettingScreen(ContentManager content, string background, Vector2 topleft,Vector2 size)
        {
            TopLeft = topleft;
            Size = size;

            Items = new List<MenuItem>();
            _Background = content.Load<Texture2D>(background);
            string[] strTextureIncre = { "TextureMenuItems\\incre0", "TextureMenuItems\\incre1" };
            string[] strTextureDecre = { "TextureMenuItems\\decre0", "TextureMenuItems\\decre1" };
            _Volumecontrol = new VolumeControl(content, this, strTextureIncre, strTextureDecre, "TextureMenuItems\\icon_bar", new Vector2(400, 100));
            _HardLevel = new CheckItem(content, this, "TextureMenuItems\\check", "TextureMenuItems\\checked", new Vector2(600, 200), Vector2.Zero, new Vector2(30, 30));
            _NormalLevel = new CheckItem(content, this, "TextureMenuItems\\check", "TextureMenuItems\\checked", new Vector2(600, 250), Vector2.Zero, new Vector2(30, 30));
            _EasyLevel = new CheckItem(content, this, "TextureMenuItems\\check", "TextureMenuItems\\checked", new Vector2(600, 300), Vector2.Zero, new Vector2(30, 30));
            Items.Add(_Volumecontrol);
            Items.Add(_HardLevel);
            Items.Add(_NormalLevel);
            Items.Add(_EasyLevel);
            NItems = Items.Count;
        }

        public override void Draw(GameTime gameTime, SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(Background, new Rectangle((int)TopLeft.X, (int)TopLeft.Y,
                                           (int)Size.X, (int)Size.Y),
                                            new Color(255, 255, 255, ScreenAlpha));


            for (int i = 0; i < _nItems; i++)
            {
                Items[i].Draw(gameTime, spriteBatch);
            }
        }
    }
}
